package book;

import java.math.BigDecimal;

public class Book {

    private String name;

    private String author;

    private BigDecimal price;

    private String type;

    private boolean isBorrowed;

    public Book() {}

    public Book(String name, String author, BigDecimal price, String type) {
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;
    }

    /**
     * 获取
     * @return name 书名
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name 书名
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return author 作者名
     */
    public String getAuthor() {
        return author;
    }

    /**
     * 设置
     * @param author 作者名
     */
    public void setAuthor(String author) {
        this.author = author;
    }

    /**
     * 获取
     * @return price 价格
     */
    public BigDecimal getPrice() {
        return price;
    }

    /**
     * 设置
     * @param price 价格
     */
    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    /**
     * 获取
     * @return type 类型
     */
    public String getType() {
        return type;
    }

    /**
     * 设置
     * @param type 类型
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     * 获取
     * @return isBorrowed 是否被借阅
     */
    public boolean isIsBorrowed() {
        return isBorrowed;
    }

    /**
     * 设置
     * @param isBorrowed 是否被借阅
     */
    public void setIsBorrowed(boolean isBorrowed) {
        this.isBorrowed = isBorrowed;
    }

    public String toString() {
        return "Book{name = " + name + ", author = " + author + ", price = " + price + ", type = " + type + ", "+(isBorrowed?" 已被借阅":" 未被借阅")+"}";
    }
}
